#!/usr/bin/env ruby
# frozen_string_literal: true

require 'optparse'
require_relative '../lib/shell'
require_relative '../lib/git'

local_path = File.join(Dir.home, '.config', 'scenario-commands')
OptionParser.new do |opts|
  opts.banner = 'Installing scenario commands'

  opts.on('-p', '--path=Dir', '克隆远程仓库到此处') do |path|
    local_path = File.expand_path(path)
  end
end.parse!

git.clone_or_skip 'scenario-commands.git', local_path
shell.rc_append "export PATH=#{local_path}:$PATH"
